length=int(input())
string=str(input())
gl_times=0
def judge(string):
    times=0
    for i in range(len(string)-1):
        if (string[i]=="V" and string[i+1]=="K") :
            times+=1
    return times
gl_times=judge(string)
for i in range(length):
    new_string=string[:i]+"V"+string[i+1:]
    gl_times=max(gl_times,judge(new_string))
    new_string=string[:i]+"K"+string[i+1:]
    gl_times=max(gl_times,judge(new_string))
print(gl_times)
